// ProductServiceImpl.java
package tech.aistar.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.mapper.ProductMapper;
import tech.aistar.pojo.Product;
import tech.aistar.service.ProductService;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public Product findById(Integer id) {
        return productMapper.findById(id);
    }

    @Override
    public int delById(Integer id) {
        return productMapper.delById(id);
    }

    @Override
    public int insertProduct(Product product) {
        return productMapper.insertProduct(product);
    }

    @Override
    public int updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public List<Product> findAll() {
        return productMapper.findAll();
    }

    @Override
    public Product searchById(Integer id) {
        return productMapper.findById(id);
    }
}